<?php
	
	class View {
		
		protected $layout;
		protected $viewPath;
		protected $data = array();
		
		public function __construct($controller, $action, $data) {
			$this->viewPath = ROOT . DS . 'application' . DS . 'view' . DS . $controller . DS . $action . '.php';
			$this->data = $data;
			strpos($action, 'Ajax') === FALSE ? $this->layout = LAYOUT :
												$this->layout = null;
		}

		public function render() {
			if ($this->layout === null) {
				require($this->viewPath);
			} else {
				$content = ($this->viewPath);
				require $this->layout;
			}
			
		}
		
	}